package testClasses.misc;

import java.util.ArrayList;

import utilities.PointInPoly;

import com.jme3.math.Vector2f;

public class PointInPolyTest {

	
	public PointInPolyTest() {}
	
	public void testNormals() {
		
		float x1 = 0;
		float y1 = 0;
		
		float x2 = -5;
		float y2 = 5;
		
		float x3 = 5;
		float y3 = 5;		
		
		Vector2f normal1 = new Vector2f(x1, y1);
		Vector2f normal2 = new Vector2f(x2, y2);
		Vector2f normal3 = new Vector2f(x3, y3);
		Vector2f normal4 = normal1;
		
		ArrayList<Vector2f> verts = new ArrayList<Vector2f>();
		verts.add(normal1);
		verts.add(normal2);
		verts.add(normal3);
		verts.add(normal1);
		
		float xt = -4.0f;
		float yt = 5.0f;
		
		System.out.println(PointInPoly.checkPoint(verts, xt, yt));
		
//		float result1 = normal1.x*xt+normal1.y*yt;
//		float result2 = normal2.x*xt+normal2.y*yt;
//		float result3 = normal3.x*xt+normal3.y*yt;
//		
//		System.out.println("Result1= " + result1);
//		System.out.println("Result2= " + result2);
//		System.out.println("Result3= " + result3);
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		PointInPolyTest test = new PointInPolyTest();
		test.testNormals();

	}

}
